home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / db / esm-3.1 / esm-3 / usr / local / sm / src / serverlib / include / disk.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-05-05  |  2.4 KB  |  97 lines

  1. /*
  2.  *   $RCSfile: disk.h,v $  
  3.  *   $Revision: 1.1.1.1 $  
  4.  *   $Date: 1996/05/04 21:55:42 $      
  5.  */ 
  6. #ifndef __DISK_H__
  7. #define __DISK_H__
  8.  
  9. /**********************************************************************
  10. * EXODUS Database Toolkit Software
  11. * Copyright (c) 1991 Computer Sciences Department, University of
  12. *                    Wisconsin -- Madison
  13. * All Rights Reserved.
  14. *
  15. * Permission to use, copy, modify and distribute this software and its
  16. * documentation is hereby granted, provided that both the copyright
  17. * notice and this permission notice appear in all copies of the
  18. * software, derivative works or modified versions, and any portions
  19. * thereof, and that both notices appear in supporting documentation.
  20. *
  21. * THE COMPUTER SCIENCES DEPARTMENT OF THE UNIVERSITY OF WISCONSIN --
  22. * MADISON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION.  
  23. * THE DEPARTMENT DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES
  24. * WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
  25. *
  26. * The EXODUS Project Group requests users of this software to return 
  27. * any improvements or extensions that they make to:
  28. *
  29. *   EXODUS Project Group 
  30. *     c/o David J. DeWitt and Michael J. Carey
  31. *   Computer Sciences Department
  32. *   University of Wisconsin -- Madison
  33. *   Madison, WI 53706
  34. *
  35. *     or exodus@cs.wisc.edu
  36. *
  37. * In addition, the EXODUS Project Group requests that users grant the 
  38. * Computer Sciences Department rights to redistribute these changes.
  39. **********************************************************************/
  40.  
  41.  
  42. typedef struct {
  43.  
  44.     long        bufIndex;    /* offset from beginning of shared memory*/
  45.     long        length;        /* number of bytes to read/write        */
  46.  
  47. } DISKIOVEC;
  48.  
  49. /*     max number of pages in one disk request */
  50. #define MAX_DISK_IOVEC 8
  51.     
  52. /*
  53.  *    message type for disk requests
  54.  */
  55. typedef struct {
  56.  
  57.     VOLID        volid;
  58.     int            threadId;
  59.     FLAGS        flags;
  60.     long        offset;            /* offset from beginning of disk    */
  61.  
  62.     /* vector of pages to read/write */
  63.     DISKIOVEC    diskVec[MAX_DISK_IOVEC];
  64.     int            diskVecCount;    /* size of diskVec */
  65.  
  66. } DISKBODY;
  67.  
  68.  
  69. /*
  70.  *    define the universal header type
  71.  */
  72. typedef struct {
  73.  
  74.     MSGHDR        header;
  75. #define diskmagic header.version
  76.     DISKBODY    body;
  77.  
  78. } DISKMSG;
  79.  
  80.  
  81. /*
  82.  *    define a magic number for the disk message type
  83.  */
  84. #define DISK_MESSAGE_MAGIC    ((SHORT_MAGIC)0xfa50)
  85.  
  86. /*
  87.  *    define the types of messages to the disk process
  88.  */
  89. #define OPEN_DISK            1
  90. #define CLOSE_DISK            2
  91. #define READ_BLOCK            3
  92. #define WRITE_BLOCK            4
  93. #define DUMP_MON            5
  94. #define FSYNC_DISK            6
  95.  
  96. #endif __DISK_H__
  97.